package com.recharge.domain.vo;

import com.recharge.common.domain.BaseDO;
import com.recharge.common.util.TemplateUtils;
import lombok.Data;

@Data
public class MerchantDO extends BaseDO {

    private String merchantNo;

    private String username;

    private String privateKey;

    private String password;

    private String callback;

    /**
     * 0.同步 1.异步
     */
    private Integer isSync;

    /**
     * 1.get 2.post
     */
    private Integer methodType;

    private String merchantName;

    private String telephone;

    private String eMail;

    private String bindAddress;

    private Long warnAmountt;

    /**
     * 0.不允许可平价 1.允许 2.不允许只能盈利
     */
    private Integer lossType;

    private Integer status;

    private Long credit;
    private Long balance;
    private Long noAmount;


    public boolean addVerification(){
        if (TemplateUtils.isEmpty(callback)){return false;}
        if (TemplateUtils.isEmpty(isSync)){return false;}
        if (TemplateUtils.isEmpty(lossType)){return false;}
        if (TemplateUtils.isEmpty(merchantName)){return false;}
        if (TemplateUtils.isEmpty(methodType)){return false;}
        if (TemplateUtils.isEmpty(password)){return false;}
        return true;
    }

    @Override
    public String toString() {
        return "MerchantDO{" +
                "merchantNo='" + merchantNo + '\'' +
                ", privateKey='" + privateKey + '\'' +
                ", password='" + password + '\'' +
                ", callback='" + callback + '\'' +
                ", isSync=" + isSync +
                ", methodType=" + methodType +
                ", merchantName='" + merchantName + '\'' +
                ", telephone='" + telephone + '\'' +
                ", eMail='" + eMail + '\'' +
                ", bindAddress='" + bindAddress + '\'' +
                ", warnAmountt=" + warnAmountt +
                ", lossType=" + lossType +
                ", status=" + status +
                ", credit=" + credit +
                ", balance=" + balance +
                ", noAmount=" + noAmount +
                '}';
    }
}
